<h3>Thêm tin tức</h3>

<form name="frm" method="" action="" enctype="multipart/form-data" class="nhaplieu">
    <table class="table">        
        <tr>
            <td style="width: 15%;"><b>Mã tin</b></td>
            <td style="width: 85%;"></td>
        </tr>
        <tr>
            <td><b>Tiêu đề</b></td>
            <td><?=$this->element->tieude?></td>
        </tr>
        <tr>
            <td><b>Mô tả</b></td>
            <td><?=$this->element->mota?></td>
        </tr>        
        <tr>
            <td><b>Danh mục cấp 1</b></td>
            <td><?=$this->element->danhmuc1?></td>
        </tr>
        <tr>
            <td><b>Danh mục cấp 2</b></td>
            <td><?=$this->element->danhmuc2?></td>
        </tr>        
        <tr>
            <td><b>Hiển thị</b></td>
            <td><?=$this->element->hienthi?></td>
        </tr>        
        <tr>
            <td><b>Nội dung</b></td>
            <td><?=$this->element->noidung?></td>
        </tr>
    </table>
              
	<input type="submit" value="Lưu" class="btn" />
	<input type="button" value="Thoát" onclick="javascript:window.location='index.php?com=news&act=man_cat'" class="btn" />    
</form>

<script type="text/javascript">
    CKEDITOR.replace('noidung',{height: 500 });
</script>
<script type="text/javascript">
    $(document).ready(function(){
        $('select#danhmuc1').change(function(){
            var id_dm1=$(this).val();
            //alert(id_dm1);
            $.ajax({
                type: "POST",
                url: "<?=BASE_URL?>/admin/tintuc/getdanhmuc2/id/"+id_dm1,                    
                //data: id_dm1,                
                dataType: 'json',
                success: function(data) {
                    $('select#danhmuc2 option[value!="0"]').remove();
                    for(var key in data)
                    {                        
                        $('select#danhmuc2').append(new Option(data[key],key));
                    }                    
                    //alert("AJAX call successful and this data was returned: " + data);                    
                },
                error: function() {
                    alert("AJAX call an epic failure");
                }
            });
            return false;                       
        });
    });   
</script>